package stz.flash.main;

import net.rim.device.api.ui.Font;
import net.rim.device.api.ui.UiApplication;
import stz.flash.Info;
import stz.flash.main.flashlight.field.ColorChangeLabel;
import util.DjObservable;
import util.DjObserver;


public class TimerField extends ColorChangeLabel implements DjObserver{

	public TimerField() {
		setFont(getFont().derive(Font.PLAIN, Info.PX_OF_3MM));
		FlashTimer.getIns().addObserver(this);
		update(FlashTimer.getIns(), null);
	}

	public void update(DjObservable observable, Object obj) {
		synchronized (UiApplication.getEventLock()) {
			setText(((FlashTimer)observable).getStringOfRemainingTime());
		}
	}
}

